package com.harlov.robanuka.objects;

import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.extension.physics.box2d.PhysicsConnector;
import org.anddev.andengine.extension.physics.box2d.PhysicsFactory;
import org.anddev.andengine.extension.physics.box2d.PhysicsWorld;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;

import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.harlov.robanuka.support.*;

public class player extends gameobject {
	
	public static int ang = 0;
	public static int health = 100;
	
	
	private static final FixtureDef FIXTURE_DEF = PhysicsFactory.createFixtureDef(0, 0, 0);;


	public player (final int posX, final int posY, final TiledTextureRegion region, PhysicsWorld World, Scene scene)
	{
		 super(posX, posY, region, World, scene);
	}
	
	
	@Override
	public void attachTo(Scene scene)
	{
		scene.getFirstChild().attachChild(getSprite());
		body = PhysicsFactory.createBoxBody(mWorld, this.getSprite(), BodyType.DynamicBody, FIXTURE_DEF);
		mWorld.registerPhysicsConnector(new PhysicsConnector(getSprite(),body,true,true));
			
		
	}
	

}
